/**
 * Created by tzngh on 2017/7/1.
 */
var censoredWords = ["sad","bad","mad"];
var customCensoreWords=[];
function censor(inStr){
    for (idx in censoredWords){
        inStr=inStr.replace(censoredWords[idx],"****");
    }
    for (idx in customCensoreWords){
        inStr=inStr.replace(customCensoreWords[idx],"****");
    }
    return inStr;
}
function addCensoredWords(word){
    customCensoreWords.push(word);
}
function getCensoredWords(){
    return censoredWords.concat(customCensoreWords);
}
exports.censore=censor;
exports.addCensoredWords=addCensoredWords;
exports.getCensoredWords=getCensoredWords;